package com.kun.portal.webframe.service;

import com.kun.portal.webframe.po.GroundServiceItemPo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.persistence.EntityManager;
import javax.persistence.Query;
import java.util.List;

/**
 * Created by Lenovo on 2018/8/9.
 */
@Service
public class GroundServiceItemService {
    @Autowired
    private EntityManager entityManager;

    public List<GroundServiceItemPo> findAll(){
        Query query= entityManager.createQuery("select distinct g from  GroundServiceItemPo g left join fetch g.airSecurityVehicle left join  fetch  g.teams  t left join fetch t.userList");
        return  query.getResultList();
    }

}
